package com.iuhao.order.controler;

import com.iuhao.order.feginclient.UserServiceClient;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/order")
public class OrderController {

    /**
     * 功能描述:
     * FeignClient 调用
     *
     * @auther: yanhao
     * @param:
     * @date: 2018/10/30 0:43
     * @Description:
     */
    @Autowired
    UserServiceClient userServiceClient;


    @Value("${productionModel}")
    private String productionModel;


    @RequestMapping(value = "/hi", method = RequestMethod.GET)
    @ApiOperation(value = "测试sayHi")
    public String sayHi(@RequestParam String name) {
        return userServiceClient.sayHiFromClientOne(name);
    }


    @RequestMapping(value = "/test", method = RequestMethod.GET)
    @ApiOperation(value = "测试")
    public String test() {
        return userServiceClient.getProductionModel();
    }
}
